<script>
import { shallowReadonly } from 'vue'
export default {
  setup() {
    const origin = {
      name: 'ifer',
      info: {
        address: '河南',
      },
    }
    // 只有第一层是只读的，内部还有对象，内部对象里面的内容可以改
    const state = shallowReadonly(origin)
    state.name = '张三'
    console.log(state.name) // 'ifer'

    state.info.address = '武汉'
    console.log(state.info.address)
  },
}
</script>
